<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<link rel="STYLESHEET" type="text/css" href="${base}/res/admin/css/tab.css"/>
	<link rel="stylesheet" href="${base}/res/comm/css/ctrl/combo.css" />
	<link rel="stylesheet" href="${base}/res/comm/css/ctrl/editor.css" />
	<link rel="stylesheet" href="${base}/res/comm/css/ctrl/button.css" />
	<script type="text/javascript" src="${base}/res/comm/js/jquery/jquery.js"></script>
	<script type="text/javascript" src="${base}/res/admin/js/admin.js"></script>
	<script lang="javascript">
		function save(){
			if ($('#menuname').val().trim()==""){
				alert("菜单名称不能为空");
				return;
			}
			ajaxPost('${base}/admin/adminmenusave.jhtml',{
					'menuid':$('#menuid').val(),
					'menuname':$('#menuname').val(),
					'descs':$('#descs').val(),
					'linkaddr':$('#linkaddr').val(),
					'ord':$('#ord').val(),
					'menutype':$('input:radio[name="menutype"]:checked').val(),
					'pmenuid':$('#pmenuid').val(),
					'status':$('input:radio[name="status"]:checked').val()
				},null,'json',savecallback);
		}
		function savecallback(data){
			window.alert(data.message);
			if(data.status=='success'){
				window.location.href='${base}/admin/adminmenulist.jhtml';	
			}
		}
	</script>
  </head>
  <body style="overflow:auto;">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="30">
	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="15" height="30"><img src="${base}/res/admin/images/tab_03.gif" width="15" height="30" /></td>
	        <td background="${base}/res/admin/images/tab_05.gif"><img src="${base}/res/admin/images/311.gif" width="16" height="16" /> <span class="STYLE4" style="16">编辑菜单</span></td>
	        <td width="14"><img src="${base}/res/admin/images/tab_07.gif" width="14" height="30" /></td>
	      </tr>
	    </table>
	    </td>
	  </tr>
	  <tr>
	    <td>
	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="9" background="${base}/res/admin/images/tab_12.gif">&nbsp;</td>
	        <td bgcolor="#e5f1d6">
	        <input type="hidden" id="menuid" name="menuid" value="${(adminMenu.menuid)!0}">
	        <table width="99%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#CECECE">
    		<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">菜单名称:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="menuname" name="menuname" value="${(adminMenu.menuname)!""}" class="x-html-editor-wrap"/></td>
		  		<td width="50%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">描述:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="descs" name="descs" value="${(adminMenu.descs)!""}" size="60" class="x-html-editor-wrap"/></td>
		  		<td width="50%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">链接地址:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="linkaddr" name="linkaddr" value="${(adminMenu.linkaddr)!""}" size="60" class="x-html-editor-wrap"/></td>
		  		<td width="50%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">排序:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input id="ord" name="ord" value="${(adminMenu.ord)!0}" class="x-html-editor-wrap"/></td>
		  		<td width="50%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">菜单类型:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input type="radio" name="menutype" value="1" <#if ((adminMenu.menutype)!1)?int==1>checked</#if>/>可见<input type="radio" name="menutype" value="2" <#if ((adminMenu.menutype)!1)?int==2>checked</#if>/>隐藏</td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">状态:</span></td>
		   		<td height="18" bgcolor="#FFFFFF"><input type="radio" name="status" value="1" <#if ((adminMenu.status)!1)?int==1>checked</#if>/>启用<input type="radio" name="status" value="0" <#if ((adminMenu.status)!1)?int==0>checked</#if>/>禁用</td>
		  		<td width="10%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF"><span class="STYLE1">父级菜单:</span></td>
		   		<td height="18" bgcolor="#FFFFFF">
		   			<select id="pmenuid" name="pmenuid">
		   			<#if adminMenuList??>
		   				<#list adminMenuList as list>
		   					<#if list.menuid == (adminMenu.pmenuid)!0>
		   					<option value="${list.menuid}" selected>${list.menuname}</option>
		   					<#elseif list.menuid != (adminMenu.menuid)!0>
		   					<option value="${list.menuid}">${list.menuname}</option>
		   					</#if>
		   				</#list>
		   			</#if>
		   			</select>
		   		</td>
		   		<td width="50%"  bgcolor="#FFFFFF">&nbsp;</td>
		  	</tr>
		  	<tr>
		   		<td height="18" bgcolor="#FFFFFF" colspan=2 align="center">
		   			<input type="button" value="保存"  onclick="save()"/>&nbsp;&nbsp;
		   			<input type="button" value="返回" onclick="window.history.back(-1)">
		   		</td>
		   		<td width="50%"  bgcolor="#FFFFFF">&nbsp;</td>
		   	</tr>
		 	</table>
        </td>
        <td width="9" background="${base}/res/admin/images/tab_16.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="29"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="29"><img src="${base}/res/admin/images/tab_20.gif" width="15" height="29" /></td>
        <td background="${base}/res/admin/images/tab_21.gif">&nbsp;</td>
        <td width="14"><img src="${base}/res/admin/images/tab_22.gif" width="14" height="29" /></td>
      </tr>
    </table></td>
  </tr>
</table>
  </body>
</html>
